﻿<%@ Page Title="" Language="C#" MasterPageFile="~/N2/Content/Framed.Master" AutoEventWireup="true"
    CodeBehind="Manage.aspx.cs" Inherits="AWS.N2CMS.Tags.Manage" %>

<%@ Import Namespace="N2" %>

<%@ Register Assembly="N2" Namespace="N2.Web.UI.WebControls" TagPrefix="n2" %>
<asp:Content ID="ContentHead" ContentPlaceHolderID="Head" runat="server">
    <style type="text/css">
        .colEdit a
        {
            display: inline !important;
        }
        .gv td
        {
            vertical-align:middle !important;
        }
    </style>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Content" runat="server">
    <h1>
        Tags</h1>
    <asp:GridView ID="gvTags" DataKeyNames="ID" runat="server" DataSourceID="tagsDataSource"
        AutoGenerateColumns="false" EmptyDataText="There are no tags" CssClass="gv" AlternatingRowStyle-CssClass="alt"
        DataMember="Query">
        <Columns>
            <asp:CommandField ShowEditButton="true" ShowDeleteButton="true" ItemStyle-CssClass="colEdit" ItemStyle-Width="100px" />
            <asp:BoundField DataField="Title" HeaderText="Tag" />
            <asp:BoundField DataField="TaggedItemsCount" HeaderText="Items Tagged" ReadOnly="true" ItemStyle-Width="100px" />
            <asp:TemplateField>
                <ItemTemplate>
                    
                    <a href="Tagged.aspx?selected=<%# Eval("ID")  %>">View tagged</a>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <n2:ItemDataSource runat="server" ID="tagsDataSource">
    </n2:ItemDataSource>
    <h2>
        New tag</h2>
    <p>
        <asp:Label ID="lblTagName" runat="server" AssociatedControlID="tbTagName">Name</asp:Label>
        <asp:TextBox ID="tbTagName" runat="server" ValidationGroup="AddTag" />
        <asp:RequiredFieldValidator runat="server" ID="rfvTagName" ErrorMessage="*" ControlToValidate="tbTagName"
            ValidationGroup="AddTag" />
    </p>
    <p>
    <asp:Button runat="server" ID="btnAddTag" Text="Insert Tag" OnClick="AddTag" ValidationGroup="AddTag" />
    </p>
</asp:Content>
